package com.sand;

import java.util.Random;

//随机生成6位验证码
public class VerificationCode {
    public static String generateVerificationCode() {
        String chars = "0123456789abcdefghijklmnopqrstuvwxyz";
        StringBuilder code = new StringBuilder();
        Random random = new Random();

        for (int i = 0; i < 6; i++) {
            int index = random.nextInt(chars.length());
            code.append(chars.charAt(index));
        }

        return code.toString();
    }

    public static void main(String[] args) {
        String verificationCode = generateVerificationCode();
        System.out.println("Verification Code: " + verificationCode);
    }
}